20200910 Synthetixのオラクルを読む
litepaperより
The oracle
The value of all synthetic assets in the Synthetix system are currently determined by oracles that push price feeds on-chain. It uses an algorithm with a variety of sources to form an aggregate value for each asset. The price feeds are currently supplied by both Chainlink’s independent node operators and Synthetix, and will soon all be supplied by Chainlink.
現在は、Synthetix独自の価格参照方法とChainlinkから価格参照の両方を使っているけれど、今後は全てChainlinkからの参照にしていく予定。
具体的にコントラクト側ではどういう形でChainlinkから情報を取得する形になっているのか見ていく。
https://gyazo.com/10a9670e56fceef4c61286dca7971f18
上図の"Synthetix"コンポーネントの中でOracleのパートが存在しており、その中のExchangeRatesコントラクトにて、外からの価格の参照を行っている
・3分ごとに価格が更新される
・登録されているaggregatorsから渡される情報を信用する
・全ての通貨の価格がsUSD建て(=1ドル)で表現されるようになっている
・フロントランニングを防ぐ仕組みとして提案されているSIP6,SIP7とこのオラクルコントラクトは相互作用する
・価格更新を行う際は、通貨の交換はできないようになっている
https://gyazo.com/24cd24fc449d3e356d5abc53331905c0